export default function reFn(state, action) {
  // console.log(action);
  switch (action.type) {
    case 'add':
      let obj1 = {...state}
      obj1[action.pname]++
      return obj1
    case 'sub':
      let obj2 = {...state}
      obj2[action.pname]--
      return obj2
    default:
      return state
  }
}